package fr.smardine.podcaster.thread;

public enum EnActivityCode {
	AUCUN(0, "AUCUN"), //
	MAIN_REQUEST_CODE(1000, "MAIN_REQUEST_CODE"), //
	MAIN_RESULT_CODE(1100, "MAIN_RESULT_CODE"), //
	AFF_ACCUEIL_DEMO_REQUEST_CODE(2000, "AFF_ACCUEIL_DEMO_REQUEST_CODE"), //
	AFF_ACCUEIL_DEMO_RESULT_CODE(2100, "AFF_ACCUEIL_DEMO_RESULT_CODE"), //
	AFF_BENEF_LIST_REQUEST_CODE(3000, "AFF_BENEF_LIST_REQUEST_CODE"), //
	AFF_BENEF_LIST_RESULT_CODE(3100, "AFF_BENEF_LIST_RESULT_CODE"), //
	AFF_BENEF_LIST_GOTOTOURNEES(3101, "AFF_BENEF_LIST_GOTOTOURNEES"), //
	AFF_BENEF_DETAIL_REQUEST_CODE(4000, "AFF_BENEF_DETAIL_REQUEST_CODE"), //
	AFF_BENEF_DETAIL_RESULT_CODE(4100, "AFF_BENEF_DETAIL_RESULT_CODE"), //
	AFF_TOURNEES_REQUEST_CODE(5000, "AFF_TOURNEES_REQUEST_CODE"), //
	AFF_TOURNEES_RESULT_CODE(5100, "AFF_TOURNEES_RESULT_CODE"), //
	AFF_TOURNEES_GOTOBENEFLIST(5101, "AFF_TOURNEES_GOTOBENEFLIST"), //
	AFF_VISITE_LIST_REQUEST_CODE(6000, "AFF_VISITE_LIST_REQUEST_CODE"), //
	AFF_VISITE_LIST_RESULT_CODE(6100, "AFF_VISITE_LIST_RESULT_CODE"), //
	AFF_VISITE_DETAIL_REQUEST_CODE(7000, "AFF_VISITE_DETAIL_REQUEST_CODE"), //
	AFF_VISITE_DETAIL_RESULT_CODE(7100, "AFF_VISITE_DETAIL_RESULT_CODE"), //
	AFF_CAMERA_PREVIEW_REQUEST_CODE(8000, "AFF_CAMERA_PREVIEW_REQUEST_CODE"), //
	AFF_CAMERA_PREVIEW_RESULT_CODE(8100, "AFF_CAMERA_PREVIEW_RESULT_CODE"), //
	AFF_BENEF_NOTE_REQUEST_CODE(9000, "AFF_BENEF_NOTE_REQUEST_CODE"), //
	AFF_BENEF_NOTE_RESULT_CODE(9100, "AFF_BENEF_NOTE_RESULT_CODE"), //
	AFF_PARAM_REQUEST_CODE(10000, "AFF_PARAM_REQUEST_CODE"), //
	AFF_PARAM_RESULT_CODE(10100, "AFF_PARAM_RESULT_CODE"), //
	AFF_PARAM_RESULT_NEWLICENCE(10101, "AFF_PARAM_RESULT_NEWLICENCE"), //
	AFF_VSTALERT_REQUEST_CODE(11000, "AFF_VSTALERT_REQUEST_CODE"), //
	AFF_VSTALERT_RESULT_CODE(11100, "AFF_VSTALERT_RESULT_CODE"), //
	AFF_BENEFPHOTOSWITCHER_REQUEST_CODE(12000,
			"AFF_BENEFPHOTOSWITCHER_REQUEST_CODE"), //
	AFF_BENEFPHOTOSWITCHER_RESULT_CODE(12100,
			"AFF_BENEFPHOTOSWITCHER_RESULT_CODE"), //
	AFF_INFO_HTML_REQUEST_CODE(13000, "AFF_INFO_HTML_REQUEST_CODE"), //
	AFF_INFO_HTML_RESULT_CODE(13100, "AFF_INFO_HTML_RESULT_CODE"), //
	AFF_ACCUEILPRESENT_REQUEST_CODE(14000, "AFF_ACCUEILPRESENT_REQUEST_CODE"), //
	AFF_ACCUEILPRESENT_RESULT_CODE(14100, "AFF_ACCUEILPRESENT_RESULT_CODE"), //
	AFF_ACCUEILPRESENT_GOTOAFFACCUEIL(14101,
			"AFF_ACCUEILPRESENT_GOTOAFFACCUEIL");//

	private int code;
	private String libelle;

	EnActivityCode(int p_code, String p_libelle) {
		code = p_code;
		libelle = p_libelle;
	}

	/**
	 * Renvoie le EnActivityCode correspondant au code passe en parametre
	 * @param p_code
	 * @return EnActivityCode.AUCUN si p_code pas trouve
	 */
	public static EnActivityCode fromCode(int p_code) {
		if (p_code > 0) {
			for (EnActivityCode v : EnActivityCode.values()) {
				if (p_code == v.code) {
					return v;
				}
			}
		}
		return EnActivityCode.AUCUN;
	}

	public int getCode() {
		return code;
	}

	public String getLibelle() {
		return libelle;
	}

}
